package com.zhongpengcheng.adapter;

import java.util.concurrent.TimeUnit;

/**
 * @author ZhongPengCheng
 * @version 1.0
 * @since 2021-12-04 16:18:00
 */
public interface RedisAdapter {
    /**
     * 设置带过期时间的缓存数据
     * @param key 缓存key
     * @param value 缓存值
     * @param timeout 缓存过期时间
     * @param timeUnit 过期时间单位
     */
    void setWithExpire(String key, String value, long timeout, TimeUnit timeUnit);
    void setWithExpire(String key, Object value, long timeout, TimeUnit timeUnit);
    String get(String key);
    <T> T get(String key, Class<T> clazz);
    boolean hasKey(String key);
}
